def isCondition1(s):
    return len(s) >= 8
def isCondition2(s):
    for c in s:
        if not ('0' <= c <= '9' or 'a' <= c <= 'z' or 'A' <= c <= 'Z'):
            return False
    return True
def isCondition3(s):
    count = 0
    for c in s:
        if '0' <= c <= '9':
            count += 1
    return count >= 2
def isCondition4(s):
    count = 0
    for c in s:
        if 'A' <= c <= 'Z':
            count += 1
    return count >= 2
passwd = input()
if isCondition1(passwd) and isCondition2(passwd) and isCondition3(passwd) and isCondition4(passwd):
    print("Yes")
else:
    print("No")